
// 此源码仅供学习使用
/**此源码仅供学习使用

1.严禁外传
2.严禁其他用途
3.如使用者违背使用规则，用作其他用途后果自负，所有责任均与作者无关 
4.使用者均已阅读此协议且使用则视为已阅读！
**/
// 1.严禁外传
// 2.严禁其他用途
// 3.如使用者违背使用规则，用作其他用途后果自负，所有责任均与作者无关 
var jiqisz=[false,false,false,false,false,false,false,true];

function Jiqi(){
    var jqsb=true;
    for (let index = 0; index < jiqisz.length; index++) {
        console.log(jiqisz[index])
       if(jiqisz[index]!=true)
       {
        jqsb=false;
       }
        
    }
    if(jqsb)
    {
        var strt="恭喜您获得了礼包：COP 357-雷霆王者觉醒版，幽，请注意：游戏虚拟道具奖品将会在24小时内到账"
        jiqisz[7]=false;
    }
    else
    {
        var strt="抱歉，您尚未集齐套装！"
    }
    $("#xtxx").text(strt);
    $("#milo_loader_layer").css("display", "block");
    setTimeout(function(){
        $("#milo_loader_layer").css("display", "none");
        Showwd("#xttc");
	},300)
}
var keynum = 200;
//定义钥匙数量
 const Paging = [
        ['M200-幻神-荣耀世冠白鲨皮肤', 0.12 * 1.000000, 15],           //0
    ['QBZ03-荣耀世冠白鲨皮肤',0.15* 1.000000,15],                       //1
    ['麒麟刺-荣耀世冠白鲨皮肤',0.25* 1.000000,10],                      //2
        ['黄金猫猫手套-白鲨', 0.2 * 1.000000, 15],                      //3
        ['火麒麟-巅峰荣耀皮肤', 0.28 * 1.000000, 12],                       //4
        ['擎天-冠军之击皮肤', 0.4 * 1.000000, 8],      //5
        ['毁灭-冠军之怒皮肤', 0.5 * 1.000000, 6],       //6
        ['修罗-冠军之魂皮肤', 0.6 * 1.000000, 4],       //7
        ['COP-白鲨 ', 0.6 * 1.000000, 4],       //8
        ['BS战队击杀图标', 0.8 * 1, 1],         //9
        ['王者之石x1', 9.9* 1, 0],          //10
        ['积分*100', 0.1 * 1, 0],           //11
        ['积分*10', 0.5 * 1, 0],          //12
        ['积分*5', 4 * 1, 0],           //13
        ['积分*3', 44, 0],          //14
        ['积分*2', 40, 0],          //15
    ['属性变更券x10',0,0],               //16
["交易专用钥匙x10",0,0],            //17
["雷神-荣耀世冠AG皮肤",0,15],           //18
["火麒麟-荣耀世冠AG皮肤",0,12],         //19
["屠龙-荣耀世冠AG皮肤",0,10],           //20
["AG战队击杀图标",0,1],                //21
["雷霆道具卡×10",0,0],  //22
    ]

var czid=0;
var czcgbool=false;
var czbool=false;
var gxzxnum=0;
var lzk=0;
var tzk=0;
var wzk=0;
var zzk=0;
var cfk=00;
var ryk=0;
var xyz=0;
var wzbox=0;
var rysgdjq=0;
var ljswznka=0;
//keyynum,xxyxnum,xyz,ccska,wwzka,yyxka,ddjka,sswznka
function setkeyjf(kkkk,ffff,xyzzz,wwww,wzwz,yxyx,djdj,swzn,rsjd)
{
    xyxnum=ffff;
    keynum=kkkk;
    cska=wwww;
    wzka=wzwz;
    yxka=yxyx;
    djka=djdj;
    jfnum=swzn;
    xyz=xyzzz;
    ljswznka=swzn;
    rysgdjq=rsjd;
    Changet();
    gailvArr =  [
            ['M200-幻神-荣耀世冠白鲨皮肤', 0.12 * 1.000000, 15],           //0
        ['QBZ03-荣耀世冠白鲨皮肤',0.15* 1.000000,15],                       //1
        ['麒麟刺-荣耀世冠白鲨皮肤',0.25* 1.000000,10],                      //2
            ['黄金猫猫手套-白鲨', 0.2 * 1.000000, 15],                      //3
            ['火麒麟-巅峰荣耀皮肤', 0.28 * 1.000000, 12],                       //4
            ['擎天-冠军之击皮肤', 0.4 * 1.000000, 8],      //5
            ['毁灭-冠军之怒皮肤', 0.5 * 1.000000, 6],       //6
            ['修罗-冠军之魂皮肤', 0.6 * 1.000000, 4],       //7
            ['COP-白鲨 ', 0.6 * 1.000000, 4],       //8
            ['BS战队击杀图标', 0.8 * 1, 1],         //9
            ['王者之石x1', 9.9* 1, 0],          //10
            ['积分*100', 0.1 * 1, 0],           //11
        ['积分*10', 0.5 * 1, 0],          //12
            ['积分*5', 4 * 1, 0],           //13
            ['积分*3', 44, 0],          //14
            ['积分*2', 40, 0],          //15
        ['属性变更券x10',0,0],               //16
    ["交易专用钥匙x10",0,0],            //17
    ["雷神-荣耀世冠AG皮肤",0,15],           //18
    ["火麒麟-荣耀世冠AG皮肤",0,12],         //19
    ["屠龙-荣耀世冠AG皮肤",0,10],           //20
    ["AG战队击杀图标",0,1],                //21
    ["雷霆道具卡×10",0,0],  //22
        ]
var SBGLVARR=UserSetgl();
        for (let index = 0; index < SBGLVARR.length; index++) {
            gailvArr[index][1]=SBGLVARR[index][1]
            
        }
        SetGailv();
    
   
}

var xyxnum=0;
var cska=0;
var wzka=0;
var yxka=0;
var djka=0;
var swznka=0;
var sxcqq=0;
var exycs=0;
var zhongqian=0;
function Changet() {
   
    swznka=jfnum;
    jfnum = swznka;
zhongqian=Math.floor(ljswznka/60);
for (let index = 0; index < (zhongqian-qianmaArr.length); index++) {
    Addqma()
    
}
    setTimeout(() => {
    $(".jf_5977").text(keynum);
    $(".jf_5982").text(swznka);
    $(".freePointNum").text(gxzxnum);
    $(".jf_2262").text(cska);
    $(".jf_2263").text(wzka);
    $(".jf_2264").text(yxka);
    $(".jf_2265").text(djka);
$(".jf_2260").text(exycs);
$(".jf_2327").text(0);
$(".jf_5944").text(0);

$("._ret_luck2_num").text(zhongqian);
$("._ret_luck1_num").text(zhongqian);
    $(".sum_num").text(xyxnum);
$(".jf_1430").text(xyz);
$(".jf_2258").text(ljswznka)
$(".jf_2327").text(rysgdjq)
}, 1000);
}




function czboxcg(){
	if(czcgbool)
	{
		if(czid==2)
		{
			var nummm=1;
		}
		if(czid==20)
		{
			var nummm=11;
		}
		if(czid==100)
		{
			var nummm=110;
		}
		$("#zhezhao").css("display","none");
		$("#czbox").css("display","none");
        $("#milo_loader_layer").css("display", "block");
	setTimeout(function(){
        $("#milo_loader_layer").css("display", "none");
KeyAdd(nummm)
	},300)
	}
if(czbool)
{
	$("#czimg").attr("src","cz/czcg.png");
czcgbool=true;
}
else
{
	$("#czimg").attr("src","cz/cz"+czid+"_2.png");
czbool=true;
	setTimeout(function(){	$("#czimg").attr("src","cz/cz"+czid+"_3.png"); },300)
}
}
function cz1(){
    czcgbool=true;
	$("#czimg").attr("src","cz/cz0.png");
	czbool=false;
	czcgbool=false;
$("#zhezhao").css("display","block");
$("#czbox").css("display","block");
czid=2;
setTimeout(function(){
$("#czimg").attr("src","cz/cz2_0.png");
setTimeout(function(){
    $("#czimg").attr("src","cz/cz2_1.png");
    setTimeout(function(){
        $("#czimg").attr("src","cz/cz2_2.png");
        },200)
    },20)


},200)


}
function cz2(){
    czcgbool=true;
	$("#czimg").attr("src","cz/cz0.png");
	czbool=false;
	czcgbool=false;
$("#zhezhao").css("display","block");
$("#czbox").css("display","block");
czid=20;
setTimeout(function(){
$("#czimg").attr("src","cz/cz20_0.png");

setTimeout(function(){
$("#czimg").attr("src","cz/cz20_1.png");
setTimeout(function(){
    $("#czimg").attr("src","cz/cz20_2.png");
    },200)
},20)

},200)


}

function cz3(){
	$("#czimg").attr("src","cz/cz0.png");
	czbool=false;
	czcgbool=false;
$("#zhezhao").css("display","block");
$("#czbox").css("display","block");
czid=100;
setTimeout(function(){
$("#czimg").attr("src","cz/cz100_0.png");

setTimeout(function(){
$("#czimg").attr("src","cz/cz100_1.png");
},200)

},200)


}
function amsBuy(buynum) {
    if(buynum==1)
    {
        Chong1()
        Changewechat()
    }
    else
    {
        Chong10()
        Changewechat()
    }
}


function djqamsBuy(buynum) {
    if(buynum==1)
    {
        Chong1()
        Changewechat()
       var price10=10-rysgdjq;

       if(price10<1)
       {
           price10=1
           rysgdjq=rysgdjq-9;
       }
       else
       {
           rysgdjq=0;
       }
       $(".cznumtext").text(price10)
        
    }
    else
    {
        Chong10()
        Changewechat()
        var price100=100-rysgdjq;

       if(price100<10)
       {
           price100=10
           rysgdjq=rysgdjq-90;
       }
       else
       {
           rysgdjq=0;
       }
       $(".cznumtext").text(price100)
    }
}



function Qrczwb() {
    closeDialog()
    $("#milo_loader_layer").css("display", "block");
     
            setTimeout(function(){
                $("#milo_loader_layer").css("display", "none");
                Changet();
           
            },300)
}
var Ckey=0;
function Chong1() {
   Ckey=1;
    Showwd(".midas_minipay_dialog_wrap_no_border");
    $(".cznumtext").text(10)
    $(".czloadbox").css("display","block");
$(".orderbox").css("display","block");
$(".odcgbox").css("display","none");

    setTimeout(() => {
        $(".czloadbox").css("display","none");
        $(".czload2box").css("display","block");

        setTimeout(() => {
            $(".czload2box").css("display","none");

        }, 800);
    }, 800);
}


function Chong10() {
   Ckey=11;
   $("#zhezhao").css("display","block");
    Showwd(".midas_minipay_dialog_wrap_no_border");
    $(".cznumtext").text(328)
    $("#odidd").text(generateCode())
    $(".czloadbox").css("display","block");
$(".orderbox").css("display","block");
$(".odcgbox").css("display","none");

    setTimeout(() => {
        $(".czloadbox").css("display","none");
        $(".czload2box").css("display","block");

        setTimeout(() => {
            $(".czload2box").css("display","none");

        }, 800);
    }, 800);
}
function generateCode() {
    // 生成前四位数字
    let code = Math.floor(Math.random() * 10000);
  
    // 生成后八位字符
    for (let i = 0; i < 8; i++) {
      let random = Math.floor(Math.random() * 36);
      let char = String.fromCharCode(random < 10 ? 48 + random : 55 + random);
      code += char;
    }
  
    // 添加破折号
    code = code.slice(0, 4) + '-' + code.slice(4, 8) + '-' + code.slice(8);
  
    return code;
  }
  
  console.log(generateCode());
  
  
  
  
var OderArr=[
    ['2023-12-18 00:45:49', 10, 'CF-20231218004549415-990364555'],
['2023-12-18 00:45:47', 100, 'CF-20231218004547723-550395868'],
['2023-12-18 00:45:44', 100, 'CF-20231218004544667-955381907'],
['2023-12-18 00:45:27', 100, 'CF-20231218004527263-779000390'],
    ['2023-12-18 00:44:13', 100, 'CF-20231218004413786-571569200'],
 ['2023-12-18 00:44:06', 10, 'CF-20231218004406617-775391211'],
['2023-12-18 00:44:03', 100, 'CF-20231218004403975-128761318'],
['2023-12-18 00:44:01', 100, 'CF-20231218004401370-233968188']]


var czcscs=0;
function Czcg3() {
 if(czcscs==0)
 {
     czcscs=1;
 }
 else
 {
    $(".orderbox").css("display","none");
    $(".odcgbox").css("display","block");
    KeyAdd(Ckey)
    if(Ckey==11)
    {

       
        AddOderArr(100)
           
     
      
      
    }
    else
    {
       
            AddOderArr(10)

    }
    czcscs=0;
 }

}

var odernum=0;
function AddOderArr(Price)
{
    const MSGDATE2=new Date();
    var mye2=MSGDATE2.getFullYear()+"";
    var mmt2=(MSGDATE2.getMonth()+1)+"";
    var mdt2=MSGDATE2.getDate()+"";
    var mhr2=MSGDATE2.getHours()+"";
    var mmn2=MSGDATE2.getMinutes()+"";
    var msc2=MSGDATE2.getSeconds()+"";
    if(mhr2.length<2){mhr2="0"+mhr2}
    if(mmn2.length<2){mmn2="0"+mmn2}
    if(msc2.length<2){msc2="0"+msc2}
    var thetime=mye2+"-"+mmt2+"-"+mdt2+" "+mhr2+":"+mmn2+":"+msc2;
    var sjs1=Math.floor(Math.random() * (999 - 100 + 1)) + 100;
    var sjs2=Math.floor(Math.random() * (999999999 - 100000000 + 1)) + 100000000;
    var odidstr="CF-"+mye2+mmt2+mdt2+mhr2+mmn2+msc2+sjs1+"-"+sjs2;
    var Newarr=[thetime,Price,odidstr]
    //OderArr.unshift(Newarr);
    var trstr="<tr id='oderlist"+(odernum+1)+"' class='odertr'><td>"+Price+"QB礼包<br>("+odidstr+")</td><td>"+Price+"元</td><td>"+thetime+"</td><td>已付款<br></td></tr>"
    $(".orderContent").prepend(trstr)
    odpagenum=1;
    OderShowPage();
    odernum=odernum+1;
}
var odpagenum=1;
var allodpage=0
function OderShowPage(){
    allodpage= parseInt(odernum/5) + 1;
    var dqpage=allodpage-odpagenum;
    if(dqpage<1){dqpage=1}
    if(dqpage>allodpage){dqpage=allodpage}
    $(".odertr").css("display","none")
    var beginid=dqpage*5
    beginid=beginid
    if(odernum-beginid<5){beginid=odernum}
    //if(beginid>odernum){ beginid=odernum}

    console.log("总页数："+allodpage+"  当前页数："+odpagenum+"开始的id"+beginid+"总行数"+odernum)

 //   $("#oderlist"+(beginid-0)).css("display","table-row")
    $("#oderlist"+(beginid-1)).css("display","table-row")
    $("#oderlist"+(beginid-2)).css("display","table-row")
    $("#oderlist"+(beginid-3)).css("display","table-row")
    $("#oderlist"+(beginid-4)).css("display","table-row")
    $("#oderlist"+(beginid-0)).css("display","table-row")
    if(beginid-1<=0){$("#oderlist"+(beginid+1)).css("display","table-row")}
    if(beginid-2<=0){$("#oderlist"+(beginid+2)).css("display","table-row")}
    if(beginid-3<=0){$("#oderlist"+(beginid+3)).css("display","table-row")}
    if(beginid-4<=0){$("#oderlist"+(beginid+4)).css("display","table-row")}
}

function Oderpagenext(Pgset)
{
    odpagenum=odpagenum+Pgset;
    if(odpagenum<1)
    {
        odpagenum=1
    }
    else if(odpagenum>allodpage)
    {
        odpagenum=allodpage
    }
    OderShowPage();
    
}

var ewmid=0;
function Changewechat(){
    $(".channel").removeClass("checked");
    $("#channel1").addClass("checked");
 
    $(".wxqbbox").css("display","block");
    $(".czload2box").css("display","block");
    $(".qqqbbox").css("display","none");
    $(".qbye").css("display","none");
ewmid=SBSDJFDWEFR();
    console.log(strszcd)
    $("#ewmaimg").attr("src","cz/ewm"+ewmid+".png")
    setTimeout(() => {
        $(".czload2box").css("display","none");

    }, 800);

}

var strszcd=""

function SBSDJFDWEFR(){
    if(strszcd.length>292){strszcd=""};
  var sbsbsjs=Math.ceil(Math.random() * 100)-1;
  if(strszcd.includes(sbsbsjs+","))
  {
      return SBSDJFDWEFR();
  }
  else
  {
      strszcd=strszcd+sbsbsjs+","
  return sbsbsjs;
    }
}

function Changeqqqb(){
    $(".channel").removeClass("checked");
    $("#channel2").addClass("checked");

    $(".wxqbbox").css("display","none");
    $(".czload2box").css("display","block");
    $(".qqqbbox").css("display","block");
    $(".qbye").css("display","none");
    setTimeout(() => {
        $(".czload2box").css("display","none");

    }, 800);
}

var logbool=false;
function logincg(){
if(logbool)
{
	$("#zhezhao2").css("display","none");
	$("#loginbox").css("display","none");
	logclick();
}
else 
{

	$("#logimg").attr("src","login2.png");
logbool=true;
}
}

var woid=99;
var wolit=["赵云","张飞","关羽","马超","黄忠"];

var gailvArr = Paging;
//定义可修改概率,且初始化。
var gailvnum = [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0][0, 0],];
//定义（初始化）概率范围数组
var zjjlt = [];
//定义中奖信息数组
var zcxxz = [
];
 zcxxz=[];


 var whbxstr=""
 //恭喜您获得了礼包： 王者之石x10,王者之石x1 ,请注意：游戏虚拟道具奖品将会在24小时内到账
//定义暂存箱数组
var hzlnum = 0;
//定义徽章令数量
var gjzjcs = 0;
//定义冠军道具中奖次数
var jyz = 0;
// //定义经验值
// var inst = new mdui.Dialog("#dialog", {
// history:false

// });
// inst.open();

SetGailv();
var empsz = [0, 0];
//定义空概率范围数组
function SetGailv() {
    for (i = 0; i < gailvArr.length; i++) {
        $("#Xgname" + i).val(gailvArr[i][0]);
        $("#Xggl" + i).val(gailvArr[i][1]);
        if (i == 0) {
            empsz = [1, gailvArr[0][1] * 100];
            gailvnum[i] = empsz;
        }
        else {
            empsz = [gailvnum[i - 1][1] + 1, gailvnum[i - 1][1] + gailvArr[i][1] * 100];
            gailvnum[i] = empsz;
        }
    }

}
//设置概率方法
Fjkeytable();
function Fjkeytable(){
    for (let index = 0; index < gailvArr.length; index++) {
        $("#gailvtable").prepend("<tr><td>"+gailvArr[gailvArr.length-index-1][0]+"</td><td>"+gailvArr[gailvArr.length-index-1][1]+"%</td></tr>");

        if(gailvArr[gailvArr.length-index-1][2]>0)
        {
            $("#fjystb").prepend("<tr><td class='fjysb1'>"+gailvArr[gailvArr.length-index-1][0]+"</td><td class='fjysb2'>"+gailvArr[gailvArr.length-index-1][2]+"</td></tr>");

        }
        

    }
}
//设置分解钥匙表方法
function KeyAdd(addnum) {

    keynum = keynum + addnum;
    if (addnum > 0) {
        //alert("您已成功添加"+addnum+"把钥匙！");
    }
    Sxsj();
    Changet();
}
// 添加钥匙方法
var jfnum=0;
//定义积分数值
var seletbool=false;
var dqxyz=1;
function Getxyz(){
    
    var sjs = Math.ceil(Math.random() * 1000);
    if(sjs<700)
    {
        dqxyz=1;
    }
    if(sjs>700)
    {
        dqxyz=5;
    }
    if(sjs>900)
    {
        dqxyz=10;
    }
    xyz=xyz+dqxyz;
    Changet();
    return dqxyz;
}


function openwzbox(){
    if(wzbox>0){
        var sjs = Math.ceil(Math.random() * 100);
        if(sjs<101){var wznum=1;}
        if(sjs<12){var wznum=10;}
        if(sjs<6){var wznum=20;}
        if(sjs<3){var wznum=30;}
        wzbox=wzbox-1;
        $("#milo_loader_layer").css("display", "block");
     
            setTimeout(function(){
                $("#milo_loader_layer").css("display", "none");
                Changet();
                $("#xtxx").text("恭喜获得礼包：王者之石x"+wznum);
                Showwd("#xttc")
            },300)
       
    }
    else
    {
        $("#xtxx").text("当前开启宝箱次数不足");
        Showwd("#xttc");
    }
}

var erxuan1=false;

function PTTSendClick1() {
    if (keynum < 1) {
        $("#xtxx").text("很抱歉，您的钥匙不足~");
        Showwd("#xttc")
    }
    else {
        var sjs = Math.ceil(Math.random() * 10000);
        //生成随机范围` 
       
        if(sjs<1)
        {
            sjs=1;
        }
        for (j = 0; j < gailvArr.length; j++) {
            var zxs = gailvnum[j][0]
            var zds = gailvnum[j][1]
          
            if (sjs >= zxs && sjs <= zds) {
                var dqxyz=Getxyz();
                $("#jlname").text(""+gailvArr[j][0]);
                //Addlbjl(dqxyz+"幸运值")
                Addlbjl(gailvArr[j][0])
               
               SetjlZcx(j);
               if(j==0||j==1||j==2||j==4)
               {
                xyxnum=xyxnum+1;
               }
            
               if (j==11) {
                jfnum=jfnum+100;
                swznka = jfnum;
            }
            if (j==12) {
                jfnum=jfnum+10;
                swznka = jfnum;
            }
            if (j==13) {
                jfnum=jfnum+5;
                swznka = jfnum;
            }
            if (j==14) {
                jfnum=jfnum+3;
                swznka = jfnum;
            }
            if (j==15) {
                jfnum=jfnum+2;
                swznka = jfnum;
            }
                //Changet();
             
            }

        }
Sxjf();
        //Sxjyz();
        Showwd("#popdc")
        KeyAdd(-1)

    }
}
//单抽方法
var wopid=0;
var wanou="";
function Addwo()
{
    $(".amsdialog_bcancel").css("display","inline-block")
    wanou=wolit[woid];
    $("#xtxx").text("确定选择 "+wolit[woid]+"玩偶（不可交易） 吗？");
    Showwd("#xttc");
    // let time = new Date()
    // ksz[0] = time.toLocaleString();
    // ksz[1] = dqdaquname;
    // ksz[2] = sjboxgailv[j][0];
    // zjjlt.push(ksz);
    // $("#milo-lotteryRecordContainer1").prepend("<tr><td>" + ksz[0] + "</td><td>" + ksz[1] + "</td><td>" + ksz[2] + "</td></tr>");
}

function Selectwo(pid){

        $(".popbtnrw").removeClass("on");
        $("#popbtnrw"+pid).addClass("on");
woid=pid;

}
function changeJc(tid)
{
    $(".sbbtn").removeClass("on");
    $(".btntab"+tid).addClass("on")
    $("#jcbox").removeClass("bxlot1")
    $("#jcbox").removeClass("bxlot2")
    $("#jcbox").removeClass("bxlot3")
    $("#jcbox").removeClass("bxlot4")
    $("#jcbox").addClass("bxlot"+tid)
    if(tid>2)
    {
        $(".btnone").addClass("btnonered")
        $(".btnten").addClass("btntenred")
        $(".boxzcdm").addClass("boxzcdmred")
    }
    else{
        $(".btnone").removeClass("btnonered")
        $(".btnten").removeClass("btntenred")
        $(".boxzcdm").removeClass("boxzcdmred")
    }
}

function Sxjf(){
    $(".exchangePoint").text(jfnum);
}
var sjboxbool=0;

var shilianshuzu=[0,0,0,0,0,0,0,0,0,0];
function PTTSendClick10() {
    if (keynum < 10) {
        $("#xtxx").text("很抱歉，您的钥匙不足~");
        Showwd("#xttc")
    }
    else {
        for (let index = 0; index < 10; index++) {
            var sjs = Math.ceil(Math.random() * 10000);
  
            if(sjs<1)
            {
                sjs=1;
            }
            //生成随机范围` 
            for (var j = 0; j < gailvArr.length; j++) {
                var zxs = gailvnum[j][0]
                var zds = gailvnum[j][1]
               
                if (sjs >= zxs && sjs <= zds) {
              
                    SetjlZcx(j);
                    
                    var dqxyz=Getxyz();
              
                  
                   
                     
                    $("#jlname" + index).text(""+gailvArr[j][0]);
                    
                    shilianshuzu[index]=gailvArr[j][0];
                    Addlbjl(gailvArr[j][0])
                   $("#jlname" + index).css("display","none")
                
                   if(j==0||j==1||j==2||j==4)
                   {
                    xyxnum=xyxnum+1;
                   }
                   if (j==11) {
                    jfnum=jfnum+100;
                    swznka = jfnum;
                }
                if (j==12) {
                    jfnum=jfnum+10;
                    swznka = jfnum;
                }
                if (j==13) {
                    jfnum=jfnum+5;
                    swznka = jfnum;
                }
                if (j==14) {
                    jfnum=jfnum+3;
                    swznka = jfnum;
                }
                if (j==15) {
                    jfnum=jfnum+2;
                    swznka = jfnum;
                }

            //    Changet();
             
                }

            }



        }


         let obj = {};
         for (let i = 0; i < shilianshuzu.length; i++) {
            if (obj[shilianshuzu[i]]) {
              obj[shilianshuzu[i]]++;
             } else {
               obj[shilianshuzu[i]] = 1;
             }
         }
        
         
    //     // 将相同元素的个数转换为数组
         let slarr = [];
        var  alljliarr=[]
         for (let key in obj) {
             slarr.push({
               id: key,
               numaa: `${obj[key]}`,
             });
         }
       for(let i=0;i<slarr.length;i++)
       {
      
         var jlistrr=slarr[i].id;
         if(slarr[i].numaa!=19)
         {
            
             var geshua=parseInt(slarr[i].numaa);
         
             if(geshua==1)
             {
                alljliarr.push(jlistrr)
                
             }
             else
             {
             for (let index = 0; index < geshua; index++) {
                 alljliarr.push(jlistrr)
                
             }
             
            }
             jlistrr=jlistrr+" "+slarr[i].numaa+"个"
         }
       //  $("#jlname" + i).text(jlistrr)
         $("#jlname" + i).css("display","block")
       
       }
     // console.log(alljliarr)
for (let index = 0; index < 10; index++) {
    $("#jlname" + index).css("display","block")
      $("#jlname" + index).text(alljliarr[index])
}
        Showwd("#popJl");
        tdhcs=0;
      
       
        KeyAdd(-10);
        Sxjf();
    }

}
//十连方法
var tdhcs=0;
function Tendh(){
if(tdhcs<10)
{
    setTimeout(function(){
        $("#jlname" + tdhcs).css("display","block")
tdhcs=tdhcs+1;
Tendh();
    },1200)
}

}


var zkdh=99;
function amsExchange2(pid){
    var zikadh=true;
if(pid==0)
{
    var zit="雷"
    var cfzjnum=81;
if(lzk==0)
{
    $("#xtxx").text("抱歉，您的“"+zit+"”字卡不足~");
    Showwd("#xttc");
    zikadh=false;
    
}
}
if(pid==1)
{
    var zit="霆"
    var cfzjnum=27;
if(tzk==0)
{
    $("#xtxx").text("抱歉，您的“"+zit+"”字卡不足~");zikadh=false;
    Showwd("#xttc");
}
}
if(pid==2)
{
    var zit="王"
    var cfzjnum=9;
if(wzk==0)
{
    $("#xtxx").text("抱歉，您的“"+zit+"”字卡不足~");zikadh=false;
    Showwd("#xttc");
}
}
if(pid==3)
{
    var zit="者"
    var cfzjnum=3;
if(zzk==0)
{
    $("#xtxx").text("抱歉，您的“"+zit+"”字卡不足~");zikadh=false;
    Showwd("#xttc");
}
}   

if(zikadh)
{
    var thestr="确定使用 1 个“"+zit+"”兑换 "+cfzjnum+"个积分 吗？当前大区【"+dqdaquname+"】【唯一性道具或角色在同一大区内，游戏仓库无法重复到账，请谨慎选择】"
    $("#xtxx").text(thestr);
     zkdh=pid;
    $(".amsdialog_bcancel").css("display","inline-block")
    
    $("#milo_loader_layer").css("display", "block");
    setTimeout(function(){
        $("#milo_loader_layer").css("display", "none");
        Showwd("#xttc");
	},300)

}
    }
    var hzldh=[
        ["M200-幻神-荣耀世冠白鲨",666,true],
        ["QBZ03-荣耀世冠白鲨",488,true],
        ["麒麟刺-荣耀世冠白鲨",338,true],
        ["黄金猫猫手套-白鲨",488,true],
        ["火麒麟-巅峰荣耀",398,true],
        ["擎天-冠军之击",268,true],
        ["毁灭-冠军之怒",208,true],
        ["修罗-冠军之魂",128,true],
        ["COP-白鲨",128,true],
        ["BS战队击杀图标",48,true],
        ["雷神-荣耀世冠AG",488,true],
        ["火麒麟-荣耀世冠AG",398,true],
        ["屠龙-荣耀世冠AG",338,true],
        ["AG战队击杀图标",48,true],
        ["属性变更券x5",10,true],
        ["交易专用钥匙x1",2,true]
    ]
   // hzlnum=9000;
   var whbdh="";
   function amsExchange(pid){
       pid=pid-1;
   var sb=pid;
   if(jfnum>=hzldh[sb][1]&&hzldh[sb][2])
   {
   $("#dhbtn"+pid).addClass("gray");
   let time = new Date()
           ksz[0] =
           ksz[1] = dqdaquname;
           ksz[2] = hzldh[sb][0];
           zjjlt.push(ksz);
          // $("#milo-lotteryRecordContainer1").prepend("<tr><td>" + time.toLocaleString() + "</td><td>" + ksz[1] + "</td><td>" + ksz[2] + "</td></tr>");
         
          
           
            jfnum=jfnum-hzldh[sb][1];
           
       Sxjf();
           hzldh[sb][2]=true;
           
          var thestr="确定使用 【"+hzldh[sb][1]+" 个积分】兑换 "+ksz[2]+" 吗？当前大区【"+dqdaquname+"】【唯一性道具或角色在同一大区内，游戏仓库无法重复到账，请谨慎选择】"
           $("#xtxx").text(thestr);
            whbdh=ksz[2];
           $(".amsdialog_bcancel").css("display","inline-block")
        cfk=jfnum;
        $("#milo_loader_layer").css("display", "block");
        setTimeout(function(){
            $("#milo_loader_layer").css("display", "none");
            Showwd("#xttc");
           
        },300)
       
   }
 
   else if(hzlnum<hzldh[sb][1]&&hzldh[sb][2]){
   
   $("#xtxx").text("抱歉，您的积分不足~");
           Showwd("#xttc");
   }
           
   
   }
//徽章兑换方法

var lqwmmbool="";
function Lqwmm(){
    
    var thestr="您确定【雾萌萌】领取到【"+$("#daqut").text()+"】下的【"+$("#username").text()+"】吗？"
    $("#xtxx").text(thestr);
    $(".amsdialog_bcancel").css("display","inline-block")
    $("#milo_loader_layer").css("display", "block");
    lqwmmbool="s";
    setTimeout(function(){
        $("#milo_loader_layer").css("display", "none");
        Showwd("#xttc");
       
    },300)
}
function Sxsj() {
    $(".lotteryPointNum").text(keynum);



}
//刷新数据方法

var sjsz = [];
var levelnum = 0;
//定义等级
function Sxjyz() {
    for (let index = 0; index < 300; index++) {
        for (let index2 = 0; index2 < 9; index2++) {
            sjsz.push([10, true])

        }
        sjsz.push([20, true])
        sjsz[0][0] = 50;
    }
var djcome=jyz+"";
var sbjyz=djcome.substring(djcome.length-2,djcome.length);
    $("#jyz").text(sbjyz);
    $(".jdt.progress_width").css("transition-duration", "1s");
  $(".jdt.progress_width").css("width",sbjyz+"%");
    $("#djt").text(Math.trunc(jyz / 100));
    levelnum = Math.trunc(jyz / 100);
for (let index = 0; index < levelnum; index++) {
$(".bp_list2").eq(index).children("a").removeClass("on");
$(".bp_list1").eq(index).children("a").removeClass("on");
}
}
Sxjyz();
//刷新经验值和徽章令的方法
function Showwd(wid) {
if(wid=="#xttc")
{
    $(".xttcbszz").css("display", "block");
}

    $("#zhezhao").css("display", "block");
    $("#ycrq").css("display", "block");
    $(wid).css("display", "block");
    $(wid).addClass("cjxuanfu");

}
// 打开弹窗方法
function ChangeGailv() {
    for (i = 0; i < Paging.length; i++) {
        gailvArr[i][0] = $("#Xgname" + i).val();
        gailvArr[i][1] = $("#Xggl" + i).val() * 1;

    }

    SetGailv();
    ShutWindow();
    $("#xtxx").text("概率和名称已保存");
    Showwd("#xttc")


}
//设置概率的方法

function ResetGailv() {
    gailvArr =  [
            ['M200-幻神-荣耀世冠白鲨皮肤', 0.12 * 1.000000, 15],           //0
        ['QBZ03-荣耀世冠白鲨皮肤',0.15* 1.000000,15],                       //1
        ['麒麟刺-荣耀世冠白鲨皮肤',0.25* 1.000000,10],                      //2
            ['黄金猫猫手套-白鲨', 0.2 * 1.000000, 15],                      //3
            ['火麒麟-巅峰荣耀皮肤', 0.28 * 1.000000, 12],                       //4
            ['擎天-冠军之击皮肤', 0.4 * 1.000000, 8],      //5
            ['毁灭-冠军之怒皮肤', 0.5 * 1.000000, 6],       //6
            ['修罗-冠军之魂皮肤', 0.6 * 1.000000, 4],       //7
            ['COP-白鲨 ', 0.6 * 1.000000, 4],       //8
            ['BS战队击杀图标', 0.8 * 1, 1],         //9
            ['王者之石x1', 9.9* 1, 0],          //10
            ['积分*100', 0.1 * 1, 0],           //11
        ['积分*10', 0.5 * 1, 0],          //12
            ['积分*5', 4 * 1, 0],           //13
            ['积分*3', 44, 0],          //14
            ['积分*2', 40, 0],          //15
        ['属性变更券x10',0,0],               //16
    ["交易专用钥匙x10",0,0],            //17
    ["雷神-荣耀世冠AG皮肤",0,15],           //18
    ["火麒麟-荣耀世冠AG皮肤",0,12],         //19
    ["屠龙-荣耀世冠AG皮肤",0,10],           //20
    ["AG战队击杀图标",0,1],                //21
    ["雷霆道具卡×10",0,0],  //22
        ]
    
    

    SetGailv();
    ShutWindow();
    $("#xtxx").text("概率和名称已重置");
    Showwd("#xttc")

}
//重置概率方法

var zjcs = 0;
var ksz = ["", "", ""]

function SetjlZcx(pid) {
    let time = new Date()
    ksz[0] = time.toLocaleString();
    ksz[1] = dqdaquname;
    ksz[2] = gailvArr[pid][0];
    zjjlt.push(ksz);
  //  $("#milo-lotteryRecordContainer1").prepend("<tr><td>" + ksz[0] + "</td><td>" + ksz[1] + "</td><td>" + ksz[2] + "</td></tr>");



    if (gailvArr[pid][2] > 0) {
        xyz=0;
        Changet();
        zjcs++;
        var ksz2 = [gailvArr[pid][0], gailvArr[pid][2], false,false,zjcs];
       
        zcxxz.unshift(ksz2);
//console.log(zcxxz);
       // $("#milo-lotteryRecordContainer2").prepend(" <tr id='zcxid" + zjcs + "'><td  id='zcxnameid" + zjcs + "'>" + ksz2[0] + "</td><td> <a  id='fckid" + zjcs + "'>[发送仓库]</a> </td><td> <a onclick='Fjkey(" + gailvArr[pid][2] + "," + zjcs + ")'  id='fjbtnid" + zjcs + "'>[分解]</a></td></tr>");
      //  console.log(zcxxz);
        ZcxPage();
        
    }


}

function Yusetzcx(pid,sffj,sffs)
{
    pid=pid-1;
    var sffsck=false;
    var sffjdl=false;
    if(sffs=="是")
    {
        sffsck=true;
    }
    else
    {
        sffsck=false;
    }
    if(sffj=="是")
    {
        sffjdl=true;
    }
    else
    {
        sffjdl=false;
    }
    zjcs++;
    var ksz2 = [gailvArr[pid][0], gailvArr[pid][2], sffsck,sffjdl,zjcs];
    zcxxz.unshift(ksz2);

    ZcxPage();
}

var zcxbcdk = false;
function Fjkey(kn, zcxid) {
var dqfjname=$("#zcxnameid"+zcxid).text();
    KeyAdd(kn);
                ShutWindow();
                $(".amsdialog_bcancel").css("display","inline-block")
                $("#xtxx").text("确认分解"+dqfjname+"获得"+kn+"把钥匙吗？");
                fjid=kn;
               // $("#xtxx").text("恭喜获得礼包：分解钥匙*" + kn);
                Showwd("#xttc")
                zcxbcdk = true;
                $("#zcxid" + zcxid).children().css("color", "lightgrey")
                $("#fckid" + zcxid).before("发送仓库")
                $("#fckid" + zcxid).remove();
                $("#fjbtnid" + zcxid).before("已分解")
                $("#fjbtnid" + zcxid).remove();

}
//分解钥匙方法







var yjlq=0;
function getPropByBatch(){
for(i=0;i<levelnum;i++)
{
get_cost_award(i+1, 1);
if(i<20)
{
get_free_award(i+1, 1);
}

}
$("#xtxx").text("一键领取完毕");
}
//一件领取方法

function ShutWindow() {
    $("#zhezhao").css("display", "none");
    $(".pop").css("display", "none");
    $(".dialog").css("display", "none");
    $(".amsdialog_modal").css("display", "none")

}
var fjid=99
function qrbtn(){


    // if(fszcxbool!="")
    // {
        
    //     $("#xtxx").text("恭喜获得礼包: "+fszcxbool);
    //     $(".amsdialog_bcancel").css("display","none")
    //     fszcxbool="";
  
    // }
    // if(whbdh!="")
    // {
        
    //     $("#xtxx").text("恭喜获得礼包: "+whbdh);
    //     $(".amsdialog_bcancel").css("display","none")
    //     whbdh="";
  
    // }
if(woid==99&&fjid==99&&fszcxbool==""&&whbdh==""&&zkdh==99&&lqxyxid==99&&exyzc==""&&wzkadhname==""&&djkadhname==""&&yxkadhname==""&&dhcsdjname==""&&lqwmmbool==""&&jrtuanid==""&&cgjrtuan==""&&lqubbid==99)
{
   closeDialog();
}
else if(lqwmmbool!="")
{
    $("#xtxx").text("抱歉，不在领取时间内。");
    $(".amsdialog_bcancel").css("display","none")
    lqwmmbool=""
}
if(cgjrtuan!=""){
    closeDialog();
    $("#milo_loader_layer").css("display", "block");
    setTimeout(function () {
           Cgjr();
           $("#milo_loader_layer").css("display", "none");
    }, 200)
}
if(jrtuanid!="")
{
    Jiatuanqr();
}
else if(woid!=99&&fjid==99)
{
    zcxxz.push([wanou+"玩偶",2,false,false,zjcs+1])
    $("#xtxx").text("恭喜获得礼包: "+wolit[woid]+"玩偶（不可交易）");
    $(".amsdialog_bcancel").css("display","none")
  


  
      //zjcs++;
      //var ksz2 = [wolit[woid], 2, false,false,zjcs];
      //zcxxz.unshift(ksz2);
//console.log(zcxxz);
     // $("#milo-lotteryRecordContainer2").prepend(" <tr id='zcxid" + zjcs + "'><td  id='zcxnameid" + zjcs + "'>" + ksz2[0] + "</td><td> <a  id='fckid" + zjcs + "'>[发送仓库]</a> </td><td> <a onclick='Fjkey(" + gailvArr[pid][2] + "," + zjcs + ")'  id='fjbtnid" + zjcs + "'>[分解]</a></td></tr>");
    //  console.log(zcxxz);
      ZcxPage();
      woid=99;

  



}
else if(woid==99&&fjid!=99)
{
    KeyAdd(fjid);
    var dqstr="恭喜获得礼包: 分解钥匙"+fjid+"个"
    $("#milo_loader_layer").css("display", "block");
    setTimeout(function(){
        $("#milo_loader_layer").css("display", "none");
        $("#xtxx").text(dqstr);
        $(".amsdialog_bcancel").css("display","none")
        ZcxPage();
    },300)
   
  fjid=99;
}
if(fszcxbool!="")
{
var strt="恭喜您获得了礼包："+fszcxbool+"，请注意：游戏虚拟道具奖品将会在24小时内到账"

$("#milo_loader_layer").css("display", "block");
setTimeout(function(){
    $("#milo_loader_layer").css("display", "none");
    $("#xtxx").text(strt);
    $(".amsdialog_bcancel").css("display","none")
    ZcxPage();
},300)
$(".amsdialog_bcancel").css("display","none")
fszcxbool="";
}
if(whbdh!="")
{
    var strt="恭喜您获得了礼包:"+whbdh+" ,请注意：游戏虚拟道具奖品将会在24小时内到账"
    Addlbjl(whbdh)
    if(whbdh=="白虎-霓虹机甲 皮肤"||whbdh=="屠龙-星火燎原 皮肤"){
        strt="抱歉，不在兑换时间区间内。"
    }
    $("#milo_loader_layer").css("display", "block");
    setTimeout(function(){
        $("#milo_loader_layer").css("display", "none");
        $("#xtxx").text(strt);
        $(".amsdialog_bcancel").css("display","none")
    },300)
whbdh="";
}

if(dhcsdjname!="")
{
if(dhcskaid==0)
{
    if(swznka<dhcsnum)
    {
        var strt="抱歉，您的剩余对应卡不足~"
    }
    else{
        if(zhongqian>=20)
        {
          
                if(dhcsdjname=="传说艾莉莎")
                {
                    jfnum=jfnum-648;
                }
                else
                {
                    jfnum=jfnum-788;
                }
            
         
             
            
       
            var strt="恭喜您获得了礼包:"+dhcsdjname+" ,请注意：游戏虚拟道具奖品将会在24小时内到账"
            Addlbjl(dhcsdjname)
            Changet();
        }
        else
        {
            var strt="抱歉，您的未中签幸运签数量不足~"
        }
    }
}
if(dhcskaid==1)
{
    if(cska<dhcsnum)
    {
        var strt="抱歉，您的剩余对应卡不足~"
    }
    else{
        if(zhongqian>=20)
        {
            if(dhcsdjname=="传说艾莉莎")
            {
                cska=cska-20;
            }
            else
            {
                cska=cska-25;
            }
            var strt="恭喜您获得了礼包:"+dhcsdjname+" ,请注意：游戏虚拟道具奖品将会在24小时内到账"
            Addlbjl(dhcsdjname)
        }
        else
        {
            var strt="抱歉，您的未中签幸运签数量不足~"
        }
    }
}





dhcsdjname="";
dhcsnum=0;
$("#milo_loader_layer").css("display", "block");
setTimeout(function(){
    $("#milo_loader_layer").css("display", "none");
    $("#xtxx").text(strt);
    $(".amsdialog_bcancel").css("display","none")
},300)
}


if(wzkadhname!="")
{
if(wzka>=wzkadhnum)
{
    var strt="恭喜您获得了礼包:"+wzkadhname+" ,请注意：游戏虚拟道具奖品将会在24小时内到账"
wzka=wzka-wzkadhnum;
Addlbjl(wzkadhname)
}
else
{
    var strt="抱歉，您的王者卡不足~"
}
wzkadhname="";
wzkadhnum=0;
$("#milo_loader_layer").css("display", "block");
setTimeout(function(){
    $("#milo_loader_layer").css("display", "none");
    $("#xtxx").text(strt);
    $(".amsdialog_bcancel").css("display","none")
},300)
}

if(djkadhname!="")
{
if(djka>=djkadhnum)
{
    var strt="恭喜您获得了礼包:"+djkadhname+" ,请注意：游戏虚拟道具奖品将会在24小时内到账"
djka=djka-djkadhnum;
Addlbjl(djkadhname)
}
else
{
    var strt="抱歉，您的道具卡不足~"
}
djkadhname="";
djkadhnum=0;
$("#milo_loader_layer").css("display", "block");
setTimeout(function(){
    $("#milo_loader_layer").css("display", "none");
    $("#xtxx").text(strt);
    $(".amsdialog_bcancel").css("display","none")
},300)
}


if(yxkadhname!="")
{
if(yxka>=yxkadhnum)
{
    var strt="恭喜您获得了礼包:"+yxkadhname+" ,请注意：游戏虚拟道具奖品将会在24小时内到账"
    Addlbjl(yxkadhname)
yxka=yxka-yxkadhnum;

}
else
{
    var strt="抱歉，您的英雄卡不足~"
}
yxkadhname="";
yxkadhnum=0;
$("#milo_loader_layer").css("display", "block");
setTimeout(function(){
    $("#milo_loader_layer").css("display", "none");
    $("#xtxx").text(strt);
    $(".amsdialog_bcancel").css("display","none")
},300)
}

if(exyzc!="")
{
   var sttr="恭喜您获得了礼包: "+exyzc+"，请注意:游戏虚拟道具奖品将会在24小时内到账确认"
   Addlbjl(exyzc)
   $("#xtxx").text(sttr);
   exycs=exycs-1;
$(".amsdialog_bcancel").css("display","none")
exyzc="";
}
if(lqxyxid!=99)
{
    if(xyxnum>=xyxjlArr[lqxyxid][1])
    {
     
        var strt="恭喜您获得了礼包："+xyxjlArr[lqxyxid][0];
        Addlbjl(xyxjlArr[lqxyxid][0])
        var striid=lqxyxid+1;
        $("#milo_loader_layer").css("display", "block");
    setTimeout(function(){
        $("#milo_loader_layer").css("display", "none");
        $("#xtxx").text(strt);
        $(".btnlqSum"+striid).addClass("gray");
        $(".btnlqSum"+striid).text("已领取")
        $(".amsdialog_bcancel").css("display","none")
        
    },300)


$(".amsdialog_bcancel").css("display","none")
lqxyxid=99;
    }
    else{
        var strt="您累计抽中荣耀世冠系列、巅峰荣耀系列道具累计次数不足"

        $("#milo_loader_layer").css("display", "block");
        setTimeout(function(){
            $("#milo_loader_layer").css("display", "none");
            $("#xtxx").text(strt);
            $(".sumlq"+(lqxyxid+1)).addClass("gray")
            $(".amsdialog_bcancel").css("display","none")
        },300)
      
        lqxyxid=99;
    }
}
if(lqubbid!=99)
{
    if(xyxnum>=2)
    {
     
        var strt="恭喜您获得了礼包："+BagArr[lqubbid]+"战队炫彩背包";
        Addlbjl(BagArr[lqubbid]+"战队炫彩背包")
      
        $("#milo_loader_layer").css("display", "block");
    setTimeout(function(){
        $("#milo_loader_layer").css("display", "none");
        $("#xtxx").text(strt);
        $(".btnlqSum9").addClass("gray");
        $(".btnlqSum9").text("已领取")
        $(".amsdialog_bcancel").css("display","none")
        
    },300)


$(".amsdialog_bcancel").css("display","none")
lqubbid=99;
    }
    else{
        var strt="您累计抽中荣耀世冠系列、巅峰荣耀系列道具累计次数不足"

        $("#milo_loader_layer").css("display", "block");
        setTimeout(function(){
            $("#milo_loader_layer").css("display", "none");
            $("#xtxx").text(strt);
           
            $(".amsdialog_bcancel").css("display","none")
        },300)
      
        lqubbid=99;
    }
}





if(zkdh!=99)
{
    if(zkdh==0)
    {
        cfk=cfk+81;
        lzk=lzk-1;
        var zjshu=81;
    }
    if(zkdh==1)
    {
        cfk=cfk+27;
        tzk=tzk-1;
        var zjshu=27;
    }
    if(zkdh==2)
    {
        cfk=cfk+9;
        wzk=wzk-1;
        var zjshu=9;
    }
    if(zkdh==3)
    {
        cfk=cfk+3;
        zzk=zzk-1;
        var zjshu=3;
    }
  
    $("#xtxx").text("恭喜获得礼包: 积分"+zjshu+"个");
    $(".amsdialog_bcancel").css("display","none")
  zkdh=99;
  Changet();
}

}

var fszcxbool = "";
function Fckff(zcxid) {
    var dqfjname = $("#zcxnameid" + zcxid).text();
    fszcxbool = dqfjname;
    kn = selectZcx[zcxid][1];
    fjzcxindex = selectZcx[zcxid][4];
    
    for(i=0;i<zcxxz.length;i++)
    {
        
        if(zcxxz[i][4]==selectZcx[zcxid][4])
        {
            zcxxz[i][3]=true;

        }
    }
   // zcxxz[Math.abs(zcxxz.length-fjzcxindex)][3] = true;
 

   
    $(".amsdialog_bcancel").css("display", "inline-block")
    var thet="确定领取 "+dqfjname+" 到【"+dqdaquname+"】吗？【唯一性道具在同一大区内，游戏仓库无法重复到账，请谨慎选择】"
    $("#xtxx").text(thet);
    
    fszcxbool=dqfjname;
    // $("#xtxx").text("恭喜获得礼包：分解钥匙*" + kn);
    Showwd("#xttc")
    zcxbcdk = true;
  


}


function closeDialog(){
    Changet();
    $(".amsdialog_bcancel").css("display","none")
    if(erxuan1)
    {
        $("#milo_loader_layer").css("display", "block");
        setTimeout(function(){
            $("#milo_loader_layer").css("display", "none");
            
           
           setTimeout(() => {
            Showwd("#text8");
            erxuan1=false;
           }, 800);
        },300)
    }
   if(seletbool)
   {
    $(".pop5").css("display", "none");
    $(".amsdialog_modal").css("display", "none")

    seletbool=false;
   }
   else{
    $(".xttcbszz").css("display", "none");
    $("#zhezhao").css("display", "none");
    $(".pop").css("display", "none");
    $(".midas_minipay_dialog_wrap_no_border").css("display", "none");
  
    $(".milo-dialog__wrapper").css("display", "none");
    $(".dialog").css("display", "none");
    $(".amsdialog_modal").css("display", "none")
    if (zcxbcdk) {
        Showwd('#showMyGiftContent2')
        zcxbcdk = false;
    }
    if(sjboxbool>0)
    {
        setTimeout(function(){
            for (let index = 0; index < sjboxbool; index++) {
                sjboxkx();
                
            }
          
            sjboxbool=0;
        },500)
    }
   }
   if(sjboxkx!="")
   {
    whbxstr="";
   }
}

// $(".amsdialog_bconfirm").click(
//     function () {
//         ShutWindow()
//         if (zcxbcdk) {
//             Showwd('#showMyGiftContent2')
//             zcxbcdk = false;
//         }
//     })
// $(".dia-close").click(
//     function () {
//         ShutWindow()
//     });
// $(".amsdialog_close").click(
//     function () {
//         ShutWindow()
//         if (zcxbcdk) {
//             Showwd('#showMyGiftContent2')
//             zcxbcdk = false;
//         }
//     })

var sjboxgailv=[
    ["赵云令牌",1,10,0],
    ["张飞令牌",11,20,0],
    ["关羽令牌",21,30,0],
    ["马超令牌",31,40,0],
    ["黄忠令牌",41,50,0],
    ["王者之石X30",51,100],
    ["王者之石X10",101,400],
    ["王者之石X1",401,1000]
];

function sjboxkx(){
    var sjs = Math.ceil(Math.random() * 1000);
    //生成随机范围` 
    for (j = 0; j < sjboxgailv.length; j++) {
        var zxs = sjboxgailv[j][1]
        var zds = sjboxgailv[j][2]
        if (sjs >= zxs && sjs <= zds) {
            whbxstr=whbxstr+ sjboxgailv[j][0]+",";
            thestr="恭喜您获得了礼包： "+whbxstr+"请注意：游戏虚拟道具奖品将会在24小时内到账"
            $("#xtxx").text(thestr);
    Showwd("#xttc");
    let time = new Date()
    ksz[0] = time.toLocaleString();
    ksz[1] = dqdaquname;
    ksz[2] = sjboxgailv[j][0];
    zjjlt.push(ksz);
    $("#milo-lotteryRecordContainer1").prepend("<tr><td>" + ksz[0] + "</td><td>" + ksz[1] + "</td><td>" + ksz[2] + "</td></tr>");
if(j<=4)
{
    sjboxgailv[j][3]=sjboxgailv[j][3]+1;
    $(".zylp").text(sjboxgailv[0][3]);
    $(".zflp").text(sjboxgailv[1][3]);
    $(".gylp").text(sjboxgailv[2][3]);
    $(".mclp").text(sjboxgailv[3][3]);
    $(".hzlp").text(sjboxgailv[4][3]);
}



        }

    }
}

/*********疯狂骰子部分**** */
var tzgailv = [
    [0, 10, 10],
    [11, 30, 6],
    [31, 60, 4],
    [61, 100, 3]
  ]
  var tznum=0;
  function Crazy(ctype) {
    if (ctype == 1) {
      if (keynum <= 0) {
        // mdui.snackbar({
        //   message: "您当前的钥匙不足1个或者疯狂骰子不足！"
        // });
        $("#xtxx").text("您当前的钥匙不足1个或者疯狂骰子不足！");
        Showwd("#xttc");
      }
      else {
        //钥匙骰子
if(tznum>0)
{
  var sjs = Math.ceil(Math.random() * 100);

for (let index = 0; index < tzgailv.length; index++) {

  if (sjs >= tzgailv[index][0] && sjs <= tzgailv[index][1]) {

    $("#xtxx").text("恭喜获得礼包："+tzgailv[index][2]+"个钥匙！");
    Showwd("#xttc");
KeyAdd(tzgailv[index][2]-1);
tznum = tznum - 1;
    $("#tznum").text(tznum);
  }

}
}
else
{
//   mdui.snackbar({
//           message: "您当前的疯狂骰子不足！"
//         });
$("#xtxx").text("您当前的疯狂骰子不足！");
Showwd("#xttc");
}
      }
    }



    if (ctype == 2) {
      if (jfnum <= 9) {
        // mdui.snackbar({
        //   message: "您当前的积分不足10个或者疯狂骰子不足！"
        // });
        $("#xtxx").text("您当前的积分不足10个或者疯狂骰子不足！");
        Showwd("#xttc");
      }
      else {
      //钥匙骰子
     
      if(tznum>0)
      {
        var sjs = Math.ceil(Math.random() * 1000);

        for (let index = 0; index < tzgailv.length; index++) {

if (sjs >= tzgailv[index][0] && sjs <= tzgailv[index][1]) {

    $("#xtxx").text("恭喜获得礼包："+tzgailv[index][2]*10+"个积分！");
    Showwd("#xttc");
jfnum = jfnum + (tzgailv[index][2]*10)-10;
         Sxjf();
       
            tznum = tznum - 1;
            $("#tznum").text(tznum);
         
          
}

}
      }
      else
      {
        // mdui.snackbar({
        //   message: "您当前的疯狂骰子不足！"
        // });
        $("#xtxx").text("您当前的疯狂骰子不足！");
        Showwd("#xttc");
      }

            
      }
    }

  }
/*********疯狂骰子部分**** */



var selectZcx = [
    ["", 0, true],
    ["", 0, true],
    ["", 0, true],
    ["", 0, true],
    ["", 0, true],
    ["", 0, true],
    ["", 0, true],
    ["", 0, true]
]
//设置当前暂存箱页面展示内容

var selectZcxPage = 1;
//设置当前暂存箱页面数
ZcxPage();
var allpagenum = parseInt(zcxxz.length / 6) + 1;
function ZcxPage() {
    $("#allpgnum").text(allpagenum);
    $("#dqpgnum").text(selectZcxPage);

    if (zcxxz.length >= 1) {
        $(".zwhqgdlb").css("display", "none")
    }
    if (selectZcxPage == 1) {
        $(".my-page-prev").addClass("my-page-forbid")
        $(".my-page-next").removeClass("my-page-forbid")
    }
    else {
        $(".my-page-prev").removeClass("my-page-forbid")
    }
    if (selectZcxPage == allpagenum) {
        $(".my-page-next").addClass("my-page-forbid")
        $(".my-page-prev").removeClass("my-page-forbid")
    }
    else {
        $(".my-page-next").removeClass("my-page-forbid")
    }
    // console.log(zcxxz.length);
    allpagenum = parseInt(zcxxz.length / 6) + 1;
    $("#page7").text(allpagenum);
    //  alert
    //    console.log("(长度)"+allpagenum)
    //    console.log(zcxxz)
    if (zcxxz.length > 6) {
        $("#page2").removeClass("yccell")

    }
    if (zcxxz.length > 12) {
        $("#page3").removeClass("yccell")
    }
    if (zcxxz.length > 18) {
        $("#page4").removeClass("yccell")
    }
    if (zcxxz.length > 24) {
        $("#page5").removeClass("yccell")
    }
    if (zcxxz.length > 30) {
        $("#page6").removeClass("yccell")
        $("#page7").removeClass("yccell")
    }

    selectZcx = [
        ["", 0, true, false, 0],
        ["", 0, true, false, 0],
        ["", 0, true, false, 0],
        ["", 0, true, false, 0],
        ["", 0, true, false, 0],
        ["", 0, true, false, 0],
        ["", 0, true, false, 0],
        ["", 0, true, false, 0]
    ]
    for (i = 0; i < 6; i++) {
        if (zcxxz[(selectZcxPage * 6) - i - 1] != null) {
            selectZcx[i] = zcxxz[(selectZcxPage * 6) - i - 1];
        }
        // console.log(zcxxz);
        //console.log(selectZcx)
        // console.log(i+".  "+zcxxz[(selectZcxPage*8)-i-1])
        //  alert((selectZcxPage*8)-i-1)
    }
    for (let index = 0; index < 6; index++) {
        if (selectZcx[index][0] == "") {
            $("#zcxid" + index).css("display", "none");
        }
        else {
            //  console.log(zcxxz);
            //console.log(index+":  "+selectZcx[index]);
            $("#zcxid" + index).css("display", "table-row");
            $("#zcxnameid" + index).text(selectZcx[index][0]);
            if (selectZcx[index][2]) {
                $(".yifenje" + index).css("display", "inline");
                $(".yifenjie" + index).css("display", "inline");
                $(".yifasong" + index).css("display", "none");
                $("#fckid" + index).css("display", "none");
                $("#fjzcid" + index).css("display", "none");
            }
            if (selectZcx[index][3]) {
                $(".yifenje" + index).css("display", "none");
                $(".yifenjie" + index).css("display", "none");
                $(".yifasong" + index).css("display", "inline");
                $("#fckid" + index).css("display", "none");
                $("#fjzcid" + index).css("display", "none");
            }
            if (selectZcx[index][2] == false && selectZcx[index][3] == false) {
                $(".yifenje" + index).css("display", "none");
                $(".yifenjie" + index).css("display", "none");
                $(".yifasong" + index).css("display", "none");
                $("#fckid" + index).css("display", "inline");
                $("#fjzcid" + index).css("display", "inline");
            }
        }

    }

}



function setPage(pgid) {
    if (pgid == 9999) {
        $(".my-page-cell").removeClass("my-page-checked");
        $("#page7").addClass("my-page-checked");
        selectZcxPage = allpagenum;
        ZcxPage();
    }
    else {
        $(".my-page-cell").removeClass("my-page-checked");
        $("#page" + pgid).addClass("my-page-checked");
        selectZcxPage = pgid;
        ZcxPage();
    }
}

function nextPage(pid) {
    if (pid == 0) {
        if (selectZcxPage > 1) {

            selectZcxPage = selectZcxPage - 1;
            if (selectZcxPage < 6) {
                $(".my-page-cell").removeClass("my-page-checked");
                $("#page" + selectZcxPage).addClass("my-page-checked");
            }
            else {
                $(".my-page-cell").removeClass("my-page-checked");
            }
            ZcxPage();
        }
    }
    if (pid == 1) {
        if (selectZcxPage + 1 <= allpagenum) {

            selectZcxPage = selectZcxPage + 1;
            if (selectZcxPage < 6) {
                $(".my-page-cell").removeClass("my-page-checked");
                $("#page" + selectZcxPage).addClass("my-page-checked");
            }
            else {
                $(".my-page-cell").removeClass("my-page-checked");
            }
            ZcxPage();
        }
    }
}


var fjzcxindex=0;
var kn=0;
function Fjjkey(zcxid) {
    var dqfjname=$("#zcxnameid"+zcxid).text();
    kn=selectZcx[zcxid][1];
    fjzcxindex=selectZcx[zcxid][4];
    
    for(i=0;i<zcxxz.length;i++)
    {
        
        if(zcxxz[i][4]==selectZcx[zcxid][4])
        {
            zcxxz[i][2]=true;

        }
    }
   // console.log(Math.abs(zcxxz.length-fjzcxindex));
 
 
                  
                    $(".amsdialog_bcancel").css("display","inline-block")
                    $("#xtxx").text("确认分解"+dqfjname+"获得"+kn+"钥匙吗？");
                    fjid=kn;
//console.log(zcxxz);
                   // $("#xtxx").text("恭喜获得礼包：分解钥匙*" + kn);
                    Showwd("#xttc")
                    zcxbcdk = true;
                    // $("#zcxid" + zcxid).children().css("color", "lightgrey")
                    // $("#fckid" + zcxid).before("x")
                    // $("#fckid" + zcxid).remove();
                    // $("#fjbtnid" + zcxid).before("已分解")
                    // $("#fjbtnid" + zcxid).remove();
    
    }
    //分解钥匙方法





    var xyxjlArr=[
        ["CFS纪念人偶 兑换券",1],
        ["十支战队背包任选一",2],
        ["擎天-冠军之击皮肤 兑换券",3],
        ["黑骑士-CFS2021皮肤 兑换券",5],
        ["幻神-CFS2022皮肤 兑换券",8],
        ["100000CF点",15],
    ]

var lqxyxid=99;
    function Linquxyx(lqid)
    {
        if(xyxnum>=xyxjlArr[lqid][1])
        {
            if(lqid==1)
            {
                Showwd('#popSelect');
            }
            else
            {
                lqxyxid=lqid;
                var thestr="确定领取吗？当前大区【"+dqdaquname+"】"
              $("#xtxx").text(thestr);
        $(".amsdialog_bcancel").css("display","inline-block")        
        $("#milo_loader_layer").css("display", "block");
        setTimeout(function(){
                    $("#milo_loader_layer").css("display", "none");
                    Showwd("#xttc");
                   
                },300)
            }
        }
        else
        {
            var strt="您累计抽中荣耀世冠系列、巅峰荣耀系列道具累计次数不足"
            $("#xtxx").text(strt);
            $(".amsdialog_bcancel").css("display","none")        
            $("#milo_loader_layer").css("display", "block");
            setTimeout(function(){
                        $("#milo_loader_layer").css("display", "none");
                        Showwd("#xttc");
                       
                    },300)
          
        }
       



    }

var lqubbid=99;
    var BagArr=["AG","BS","KZ","Q9","R.LGD","WE","EDG","EP","XPOCK","eStar"]
    function amsSelect(bbid)
    {
    bbid=bbid-1;
    lqubbid=bbid;
    var thestr="确定领取吗？当前大区【"+dqdaquname+"】"
      $("#xtxx").text(thestr);
$(".amsdialog_bcancel").css("display","inline-block")        
$("#milo_loader_layer").css("display", "block");
setTimeout(function(){
            $("#milo_loader_layer").css("display", "none");
            Showwd("#xttc");
           
        },300)
    }

    function amsLqSum(lqid)
    {
        Linquxyx(lqid-1);
    }



    var exyname="王者之石x10";

    function ChangeExy(cgid){
        if(cgid==0)
        {
            exyname="属性抽取券x1"
            $(".fc_box7").addClass("cur");
        }
        else
        {
            exyname="王者之石x10"
            $(".fc_box7").removeClass("cur");
        }
    }
var exyzc=""
    function linquexy(){
        exyzc=exyname;
        var thet="确定领取 "+exyname+" 到游戏内吗？当前大区【"+dqdaquname+"】"
        $("#xtxx").text(thet);
        $(".amsdialog_bcancel").css("display","inline-block")
        $("#milo_loader_layer").css("display", "block");
        setTimeout(function(){
            $("#milo_loader_layer").css("display", "none");
            Showwd("#xttc");
          
        },300)
    }

var kkaid=0;
var kkanum=0;
var dhhdjka=0;
   var exkaarr=[["传说卡",33],["王者卡",3],["英雄卡",2],["道具卡",1]]
    function Exchangeka(kaid,kanum)
    {
       var qrstr="确认消耗"+kanum+"张“"+exkaarr[kaid][0]+"”兑换"+kanum*exkaarr[kaid][1]+"张“积分”吗？"
$(".exchangeCardTip").text(qrstr);
Showwd('#exchangeCardPop')
kkaid=kaid;
kkanum=kanum;
dhhdjka=kanum*exkaarr[kaid][1];
    }

    function qrexka(){
if(kkaid==0)
{
    var dqkanum=cska;
}
if(kkaid==1)
{
    var dqkanum=wzka;
}
if(kkaid==2)
{
    var dqkanum=yxka;
}
if(kkaid==3)
{
    var dqkanum=djka;
}

if(dqkanum<kkanum)
{
    
    var thet="抱歉，您的剩余对应卡片不足~"
    $("#xtxx").text(thet);
    $("#milo_loader_layer").css("display", "block");
    setTimeout(function(){
        $("#milo_loader_layer").css("display", "none");
        Showwd("#xttc");
      
    },300)
}
else
{
    if(kkaid==0)
    {
        cska=cska-kkanum;
    }
    if(kkaid==1)
    {
        wzka=wzka-kkanum;
    }
    if(kkaid==2)
    {
        yxka=yxka-kkanum;
    }
    if(kkaid==3)
    {
        djka=djka-kkanum;
    }
    jfnum=jfnum+dhhdjka;
    swznka = jfnum;
    ljswznka=ljswznka+dhhdjka;
    var thet="恭喜您获得了礼包： 积分 *"+dhhdjka;
    $("#xtxx").text(thet);
    $("#milo_loader_layer").css("display", "block");
    setTimeout(function(){
        $("#milo_loader_layer").css("display", "none");
        Showwd("#xttc");
      
    },300)
}



    }







var wzkadhname="";
var wzkadhnum=0;
    function wzkaduihuan(wzdhid) {
        if(wzdhid==0)
        {
            var jlistr="白虎之魄"
            var dhwzkanum=92;
        }
        else
        {
            var jlistr="觉醒版 王者之势"
            var dhwzkanum=46;
        }
        var thestr="确定使用 【"+dhwzkanum+" 个王者卡】兑换 "+jlistr+" 吗？当前大区【"+dqdaquname+"】【唯一性道具或角色在同一大区内，游戏仓库无法重复到账，请谨慎选择】"
        $("#xtxx").text(thestr);
        wzkadhname=jlistr;
        wzkadhnum=dhwzkanum;
        $(".amsdialog_bcancel").css("display","inline-block")
     $("#milo_loader_layer").css("display", "block");
     setTimeout(function(){
         $("#milo_loader_layer").css("display", "none");
         Showwd("#xttc");
     },300)




    }


    var djkadhname="";
    var djkadhnum=0;
        function amsExchangeDjk(djdhid) {
            if(djdhid==1)
            {
                var jlistr="Scar Light-白虎音效卡兑换券"
                var dhwzkanum=137;
            }
            if(djdhid==2)
            {
                var jlistr="炼狱-迷你小钢(不可交易)"
                var dhwzkanum=61;
            }
            if(djdhid==3)
            {
                var jlistr="金刚伞"
                var dhwzkanum=20;
            }
            var thestr="确定使用 【"+dhwzkanum+" 个道具卡】兑换 "+jlistr+" 吗？当前大区【"+dqdaquname+"】【唯一性道具或角色在同一大区内，游戏仓库无法重复到账，请谨慎选择】"
            $("#xtxx").text(thestr);
            djkadhname=jlistr;
            djkadhnum=dhwzkanum;
            $(".amsdialog_bcancel").css("display","inline-block")
         $("#milo_loader_layer").css("display", "block");
         setTimeout(function(){
             $("#milo_loader_layer").css("display", "none");
             Showwd("#xttc");
         },300)
    
    
    
    
        }
    


        var yxkadhname="";
var yxkadhnum=0;
    function amsExchangeYxk(wzdhid) {
        if(wzdhid==1)
        {
            var jlistr="M4A1-黑骑士"
            var dhwzkanum=27;
        }
        else
        {
            var jlistr="沙鹰-修罗"
            var dhwzkanum=20;
        }
        var thestr="确定使用 【"+dhwzkanum+" 个英雄卡】兑换 "+jlistr+" 吗？当前大区【"+dqdaquname+"】【唯一性道具或角色在同一大区内，游戏仓库无法重复到账，请谨慎选择】"
        $("#xtxx").text(thestr);
        yxkadhname=jlistr;
        yxkadhnum=dhwzkanum;
        $(".amsdialog_bcancel").css("display","inline-block")
     $("#milo_loader_layer").css("display", "block");
     setTimeout(function(){
         $("#milo_loader_layer").css("display", "none");
         Showwd("#xttc");
     },300)




    }


var dhcskaid=0;
var dhcsdjname="";
var dhcsnum=0;
    function amsLqSign(dhid,dhfsid,dhkaid,tiptext) {
        if(dhid==1)
        {
            var jiangliname="传说夜影 无序列号版"
            if(dhkaid==1)
            {
dhcskaid=0;
dhcsnum=788;
            }
            else
            {
                dhcskaid=1;
dhcsnum=25;
            }
         
        }

        if(dhid==2)
        {
            var jiangliname="传说艾莉莎"
            if(dhkaid==1)
            {
dhcskaid=0;
dhcsnum=648;
            }
            else
            {
                dhcskaid=1;
dhcsnum=20;
            }
         
        }
        dhcsdjname=jiangliname;
      //  确定使用【20张未中签+648张积分】兑换【传说艾莉莎】吗？当前大区【广东电信一区】
        var thestr="确定使用 【"+tiptext+"】兑换 【"+jiangliname+"】 吗？当前大区【"+dqdaquname+"】"
        $("#xtxx").text(thestr);
        $(".amsdialog_bcancel").css("display","inline-block")
     $("#milo_loader_layer").css("display", "block");
     setTimeout(function(){
         $("#milo_loader_layer").css("display", "none");
         Showwd("#xttc");
     },300)
    }


var ztingss=0
  function PTTSendClick(sdsa,dsad,qwewq) {
      if(ztingss==0)
      {
          ztingss==1;
          setTimeout(function(){
              ztingss=0;
          },6000)
      }
      else
      {
        $("#xtxx").text("抱歉，您访问的太频繁了");
        $(".amsdialog_bcancel").css("display","inline-block")
     $("#milo_loader_layer").css("display", "block");
     setTimeout(function(){
         $("#milo_loader_layer").css("display", "none");
         Showwd("#xttc");
     },300)

      }
  } 


var LbjlArr=[
]

function Addlbjl(lbstr){
    var dtime = new Date();
    var yy=dtime.getFullYear()
    var mm=dtime.getMonth()+1
    var dd=dtime.getDate()

    var hh=dtime.getHours();
    var mm2=dtime.getMinutes();
    var ss=dtime.getSeconds();
    if(dd<10){
        dd="0"+dd;
    }
    if(mm<10){
        mm="0"+mm;
    }
    if(hh<10){
        hh="0"+hh;
    }
    if(mm2<10){
        mm2="0"+mm2;
    }
    if(ss<10){
        ss="0"+ss;
    }
    var thetime=yy+"-"+mm+"-"+dd+" "+hh+":"+mm2+":"+ss;
    var thearr=[thetime,lbstr,dqdaquname]
    LbjlArr.unshift(thearr)
    lbZcxPage();
   
}






var selectLbarr = [
    ["", "", ""],
    ["", "", ""],
    ["", "", ""],
    ["", "", ""],
    ["", "", ""],
    ["", "", ""],
    ["", "", ""],
    ["", "", ""],
    ["", "", ""],
    ["", "", ""],
    ["", "", ""],
    ["", "", ""]
]
//设置当前暂存箱页面展示内容

var selectLbPage = 1;
//设置当前暂存箱页面数
lbZcxPage();
var lballpagenum = parseInt(LbjlArr.length / 12) + 1;
function lbZcxPage() {

    if (LbjlArr.length >= 1) {
        $(".zwhqgdlb").css("display", "none")
    }
    if (selectLbPage == 1) {
        $(".lbmy-page-prev").addClass("my-page-forbid")
        $(".lbmy-page-next").removeClass("my-page-forbid")
    }
    else {
        $(".lbmy-page-prev").removeClass("my-page-forbid")
    }
    if (selectLbPage == lballpagenum) {
        $(".lbmy-page-next").addClass("my-page-forbid")
        $(".lbmy-page-prev").removeClass("my-page-forbid")
    }
    else {
        $(".lbmy-page-next").removeClass("my-page-forbid")
    }
    // console.log(LbjlArr.length);
    lballpagenum = parseInt(LbjlArr.length / 12) + 1;
    $("#lballpg").text(lballpagenum)
    $("#lbpagelast").text(lballpagenum);
    //  alert
    //    console.log("(长度)"+lballpagenum)
    //    console.log(LbjlArr)
    if (LbjlArr.length > 12) {
        $("#lbpage2").removeClass("yccell")

    }
    if (LbjlArr.length > 25) {
        $("#lbpage3").removeClass("yccell")
    }
    if (LbjlArr.length > 37) {
        $("#lbpage4").removeClass("yccell")
    }
    if (LbjlArr.length > 49) {
        $("#lbpage5").removeClass("yccell")
    }
    if (LbjlArr.length > 61) {
        $("#lbpageb").removeClass("yccell")
        $("#lbpagelast").removeClass("yccell")
    }

    selectLbarr = [
        ["", "", ""],
        ["", "", ""],
        ["", "", ""],
        ["", "", ""],
        ["", "", ""],
        ["", "", ""],
        ["", "", ""],
        ["", "", ""],
        ["", "", ""],
        ["", "", ""],
        ["", "", ""],
        ["", "", ""]
    ]
    for (i = 0; i < 12; i++) {
        if (LbjlArr[(selectLbPage * 12) - i - 1] != null) {
            selectLbarr[i] = LbjlArr[(selectLbPage * 12) - i - 1];
        }
        // console.log(LbjlArr);
        //console.log(selectLbarr)
        // console.log(i+".  "+LbjlArr[(selectLbPage*12)-i-1])
        //  alert((selectLbPage*12)-i-1)
    }
    for (let index = 0; index < 12; index++) {
        if (selectLbarr[index][0] == "") {
            $("#lbjli" + index).css("display", "none");
        }
        else {
            //  console.log(LbjlArr);
            //console.log(index+":  "+selectLbarr[index]);
            $("#lbjli" + index).css("display", "table-row");
            $("#lbjltime" + index).text(selectLbarr[index][0]);
            $("#lbjldq" + index).text(selectLbarr[index][2]);
            $("#lbjlnr" + index).text(selectLbarr[index][1]);
        }

    }

}


function nnnname(){
    PTTSendClick10()
    PTTSendClick10()
    PTTSendClick10()
    PTTSendClick10()
    PTTSendClick10()
    PTTSendClick10()
    PTTSendClick10()
    PTTSendClick10()
    PTTSendClick10()
    PTTSendClick10()
}


function lbsetPage(pgid) {
 
  
     if(pgid<=5){
        $(".lbmy-page-cell").removeClass("my-page-checked");
        $("#lbpage" + pgid).addClass("my-page-checked");
        selectLbPage = pgid;
        lbZcxPage();
        $(".lastlbpg").css("display","none")
        $(".di5ye").css("display","none")
        if (LbjlArr.length > 12) {
            $("#lbpage2").css("display","inline-block")
            $("#lbpage2").removeClass("yccell")
        }
        if (LbjlArr.length > 25) {
            $("#lbpage3").css("display","inline-block")
        }
        if (LbjlArr.length > 37) {
            $("#lbpage4").css("display","inline-block")
        }
        if (LbjlArr.length > 49) {
            $("#lbpage5").css("display","inline-block")
        }
        if (LbjlArr.length > 61) {
            $("#lbpageb").css("display","inline-block")
            $("#lbpagelast").css("display","inline-block")
        }
    }
    if(pgid>4&&lballpagenum>6)
    {
        selectLbPage = pgid;
        lbZcxPage();
        $("#lbpagec9").text(selectLbPage-1)
        $("#lbpagec8").text(selectLbPage)
        $("#lbpagec10").text(selectLbPage+1)
        $("#lbpagec8").addClass("my-page-checked");
        $(".di5ye").css("display","inline-block")
        $(".xydwye").css("display","none")
        $(".lastlbpg").css("display","none")
    }
    if((lballpagenum-pgid)<=4&&pgid!=lballpagenum&&lballpagenum>6)
    {
        selectLbPage = pgid;
        lbZcxPage();
        $("#lbpagelast4").text(lballpagenum-4)
        $("#lbpagelast3").text(lballpagenum-3)
        $("#lbpagelast2").text(lballpagenum-2)
        $("#lbpagelast1").text(lballpagenum-1)
        $(".lbmy-page-cell").removeClass("my-page-checked");
        $("#lbpagelast"+(lballpagenum-pgid)).addClass("my-page-checked");
  
        $(".di5ye").css("display","none")
        $(".xydwye").css("display","none")
        $(".lastlbpg").css("display","inline-block")
    }
    if(lballpagenum==pgid)
    {
        
        $(".lbmy-page-cell").removeClass("my-page-checked");
        $("#lbpage"+pgid).addClass("my-page-checked");
        $("#lbpagelast").addClass("my-page-checked");
        selectLbPage = lballpagenum;
        lbZcxPage();
        $(".di5ye").css("display","none")
        $(".xydwye").css("display","none")
        $(".lastlbpg").css("display","inline-block")
        $("#lbpgnextid").css("display","none");
        
    }
    else{
        $("#lbpgnextid").css("display","inline-block");
    }
    $("#lballpg").text(lballpagenum)
    $("#lbnowPage").text(pgid)
   console.log("当前页面"+pgid+"   总页数"+lballpagenum)
}
function  lastlbpg() {
    lbsetPage(lballpagenum)
}
function  Lastppg(pgjn) {
    lbsetPage(lballpagenum+pgjn)
}
function lbnextPage(pid) {
    if (pid == 0) {
        if (selectLbPage > 1) {
            lbsetPage( selectLbPage - 1)
       
            
            lbZcxPage();
        }
    }
    if (pid == 1) {
        if (selectLbPage + 1 <= lballpagenum) {

            lbsetPage( selectLbPage + 1)
            if (selectLbPage < 6) {
              //  $(".lbmy-page-cell").removeClass("my-page-checked");
               // $("#lbpage" + selectLbPage).addClass("my-page-checked");
            }
            else {
             //   $(".lbmy-page-cell").removeClass("my-page-checked");
            }
            lbZcxPage();
        }
    }
}





var qianmaArr=[
]

function Addqma(){
var tqm=Math.floor(Math.random() * (100000 - 10000 + 1)) + 10000;
var weq=Math.ceil(Math.random()*100);
if(weq<5)
{
    var thearr=[tqm,true]
}
else
{
    var thearr=[tqm,false]
}
    qianmaArr.unshift(thearr)
    Sxqma();
   
   qmallpagenum=parseInt(qianmaArr.length / 10) + 1
}






var selectQmarr = [
[0,false],
[0,false],
[0,false],
[0,false],
[0,false],
[0,false],
[0,false],
[0,false],
[0,false],
[0,false]
]
//设置当前暂存箱页面展示内容

var qmaPage = 1;
//设置当前暂存箱页面数
Sxqma();
var qmallpagenum = parseInt(qianmaArr.length / 10) + 1;
function Sxqma() {
    selectQmarr = [
        [0,false],
        [0,false],
        [0,false],
        [0,false],
        [0,false],
        [0,false],
        [0,false],
        [0,false],
        [0,false],
        [0,false]
    ]
    for (i = 0; i < 10; i++) {
        if (qianmaArr[(qmaPage * 10) - i - 1] != null) {
            selectQmarr[i] = qianmaArr[(qmaPage * 10) - i - 1];
        }
        // console.log(qianmaArr);
        //console.log(selectQmarr)
        // console.log(i+".  "+qianmaArr[(qmaPage*10)-i-1])
        //  alert((qmaPage*10)-i-1)
    }
    for (let index = 0; index < 10; index++) {
        if (selectQmarr[index][0] == "") {
            $("#zqli" + index).css("display", "none");
        }
        else {
            //  console.log(qianmaArr);
            //console.log(index+":  "+selectQmarr[index]);
            $("#zqli" + index).css("display", "table-row");
            $("#qma" + index).text(selectQmarr[index][0]);
if(selectQmarr[index][1])
{
    $("#yzq" + index).text("未中签");
}
else
{
    $("#yzq" + index).text("未中签");
}
        }

    }

}

function lucknextPage(ttpid) {
    if (ttpid == 'r') {
        if (qmaPage > 1) {

            qmaPage = qmaPage - 1;
            Sxqma();
        }
    }
    if (ttpid == 's') {
        if (qmaPage + 1 <= qmallpagenum) {

            qmaPage = qmaPage + 1;
            Sxqma();
           
        }
    }
 
}

function signList(p1,p2) {
    if(p2==1)
    {
        $(".td1").text("传说夜影 无序列号版")
    }
    else
    {
        $(".td1").text("传说艾莉莎")
    }
    $("#milo_loader_layer").css("display", "block");
    setTimeout(function(){
        $("#milo_loader_layer").css("display", "none");
        Showwd("#luck1");
	},300)
}




var tjtarr=["2tkda6dip27299fz6d","4rkqld22h27310tj3v","7cuoogjki27314yp7v","9hrffir5y27316ox6d","1unkssamx27205vb1g","5fzefmspk27334bz5y","7ckeyagqt27335vs8z","7cmmyvkm427311xi1g","2tzlftjku27338ht2m","3edl30hla27339bs2m","3efrx3qxz27341ac2m","3elc2wl1z27340jx5y","2tzlftjku27338ht2m","3edl30hla27339bs2m","3efrx3qxz27341ac2m","3elc2wl1z27340jx5y","6znraowog27349fw2m","6ztyngmij27352dt4w","8rmovkpb927351xt6d","8rvwkhpxo27353au1g","9hhdfpf8d27350ks7v","1uvhmjjvv27360cz5y","3elljjuy627356ru1g","6zga0xvhm27359qd6d","7cqouy9bk27354yn8z","8rkrfjtup27362nj6d","1uqsdigqr27358kx2m","2tvnoy4rl27367fi6d","4rwidpl3x27364yj5y","7cqouy9bk27354yn8z","9hlm1kmmi27363ck3v","1uqsdigqr27358kx2m","3erd9wvwf27365rh1g","4rtfukgdj27366fc7v","9hhqsvzt327370tc8z","9hlm1kmmi27363ck3v","4rbvbidlc27368ff5y","4rtfukgdj27366fc7v","7cyg0g1ys27373ra3v","8rmzfrfff27371ca6d","9hhqsvzt327370tc8z","1utjgt1hm27376fy5y","4rxd2givk27378ff3v","5fqwapj4927374sz4w","6zdnrmxbu27372ai8z","8rmzfrfff27371ca6d","4rxd2givk27378ff3v","8rlukopxg27379to1g","2trczc1dv27377ji7v","3ehrziavo27384wa6d","7chul61zg27383gi9h","8rsgorscm27382in6d","1uwwnrwhq27385ok7v","8rsgorscm27382in6d","1uvft50k327387sh7v","2tqjhslxj27388uz5y","4rtzbwrlp27389ha2m","8rdlw45yu27312xc6d","3emcsvrkh27386ek8z","5feobzqk227391td7v","8raxqokbl27392cn4w","8rjrpqngo27393yz8z","5fbw8c4hw27395nj1g","5feobzqk227391td7v","8raxqokbl27392cn4w","5fbw8c4hw27395nj1g","5fzbuexkn27399vu8z","7cywxmfsh27397vk3v","8rqpjocsb27396cz5y","5fbw8c4hw27395nj1g","5fzbuexkn27399vu8z","7cywxmfsh27397vk3v","8rqpjocsb27396cz5y","2tnzhsgw527424ny8z","2tpe6yalv27423vg9h","6zxt4hyng27418mx4w","7cmg9zdwq27426id5y","9hslx0aoj27422yp4w","4rav15dji27420xs4w","4rgct0c2n27427be8z","7cmg9zdwq27426id5y","7coklvakz27430vw7v","9hnow5osy27429id6d","1uiqgimez27434bf8z","4ruj2if3427433ga9h","4rvfakpgg27398ta8z","7coklvakz27430vw7v","9hdcgvmqc27412wo8z","1uiz0find27431dn6d","4ruj2if3427433ga9h","4rvfakpgg27398ta8z","5fpcbm2s727435zi9h","6zcvswump27432je2m","4rutmnckp27438lj9h","5fjjwhpmt27439td5y","7caupvog927440tg3v"]
var tjtarr2=["","","","",""]
var strstrarr=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"];
Sxtjtuan();
function Sxtjtuan(){

    for(i=0;i<2;i++)
    {
      var lsstr=tjtarr[Math.ceil(Math.random() * tjtarr.length)];
        $("#tjtli"+i).text(lsstr)
tjtarr2[i]=lsstr;

    }


}
var jrtuanid="";


function jiatuan(jtstr){
    if(jtstr==0)
    {
        jrtuanid=$("#join_teamid").val();
       
    }
    else if(jtstr==1)
    {
        jrtuanid=$("#tjtli0").text();
}
else if(jtstr==2)
{
    jrtuanid=$("#tjtli1").text();
}
if(jrtuanid==""){
    $("#xtxx").text("请输入您要加入的团队ID");
    $(".amsdialog_bcancel").css("display","none")
   
   $("#milo_loader_layer").css("display", "block");
   setTimeout(function(){
       $("#milo_loader_layer").css("display", "none");
       Showwd("#xttc");
   },300)
   
}
else
{
    $("#xtxx").text("确认消耗40积分加入【"+jrtuanid+"】，请确认？");
    $(".amsdialog_bcancel").css("display","inline-block")
   
   $("#milo_loader_layer").css("display", "block");
   setTimeout(function(){
       $("#milo_loader_layer").css("display", "none");
       Showwd("#xttc");
   },300)
}            
}


function TGDialogS(popid)
{
    Showwd("#"+popid)
}



function DDhplay(){
    if(yunyinnum>0)
    {
    $("#xtxx").text("恭喜获得礼包: "+choseplayname[dhplay]);
    $(".amsdialog_bcancel").css("display","none");
    SetjlZcx(17+dhplay);
    yunyinnum=yunyinnum-1;
    dhplay=0;
    }
    else
    {
        $("#xtxx").text("抱歉，您的女主播角色语音包4选1资格不足~");
        $(".amsdialog_bcancel").css("display","none")
        dhplay=0;
    }
}
function openwz(){
    
    if(yunyinnum>0)
    {
   var jlinamee="";
        var sjs = Math.ceil(Math.random() * 10);
        if(sjs<=10){ jlinamee=wzzsarr[3] }
        if(sjs<=7){ jlinamee=wzzsarr[2] }
        if(sjs<=3){ jlinamee=wzzsarr[1] }
        if(sjs<=1){ jlinamee=wzzsarr[0] }
    
    $("#xtxx").text("恭喜获得礼包: "+jlinamee);
    $(".amsdialog_bcancel").css("display","none");
    yunyinnum=yunyinnum-1;
    }
    else
    {
        $("#xtxx").text("抱歉，您的剩余开启王者之石礼盒次数不足。");
        $(".amsdialog_bcancel").css("display","none")
        dhplay=0;
    }
    $("#milo_loader_layer").css("display", "block");
    setTimeout(function(){
        $("#milo_loader_layer").css("display", "none");
        Showwd("#xttc");
	},300)
}




function Jiatuanqr(){
    if(swznka>14)
    {
        var sjs = Math.ceil(Math.random() * 100);
        if(sjs<30)
        {
            $("#xtxx").text("该拼团已开团成功");
            $(".amsdialog_bcancel").css("display","none")
            jrtuanid="";
        }
        else
        {
            $("#xtxx").text("加入成功");
            $(".amsdialog_bcancel").css("display","none")
    cgjrtuan=jrtuanid;
            jrtuanid="";
            jfnum=jfnum-15;
            swznka=jfnum;
        }
        
    }
    else
    {
        $("#xtxx").text("抱歉，您的剩余积分不足。");
            $(".amsdialog_bcancel").css("display","none")
            jrtuanid="";
    }
    
    }


       
var cgjrtuan="";
var usertnum=0;
function Cgjr(){
$("#my_teamid").val(cgjrtuan);
cgjrtuan="";
var d = new Date();
var y=d.getFullYear();
var m=d.getMonth()+1;
var day=d.getDate();
var h=d.getHours();
var mn=d.getUTCMinutes();
var s=d.getSeconds();
//2023-06-27 22:34:08
var timestr=y+"-"+m+"-"+day+" "+h+":"+mn+":"+s;
$(".teamTime").text(timestr);
$(".teamStatus").text("待开团")

$(".myGiftName").text("xxx")
$("#teamlist").css("display","block");
usertnum=Fwrandom(1,4);
for (let index = 0; index < 6; index++) {
    if(usertnum!=index)
    {
        Changeteam(index);
    }
    
    
}
var usqn=$("#qqid").text();
var usqq=usqn.substring(0,3)+"**"+usqn.substring(usqn.length-2, usqn.length);
$("#tq"+usertnum).text(usqq);
$("#tn"+usertnum).text($("#username").text());
$("#tjl"+usertnum).text("xxx");


}
function Changeteam(tidd)
{
var tqqr=Fwrandom(100,999)+"**"+Fwrandom(10,99);
var tqqname=username[Math.ceil(Math.random() * username.length-1)];
$("#tq"+tidd).text(tqqr);
$("#tn"+tidd).text(tqqname);
$("#tjl"+tidd).text("xxx");
if(tidd>usertnum-1)
{
    $("#ttr"+tidd).css("display","none");
}
else
{
    $("#ttr"+tidd).css("display","flex"); 
}
}
var userhzid=5;
var Ptuanhearr=["属性变更券×10","荣耀世冠AG礼盒×1","荣耀世冠白鲨礼盒","交易专用钥匙×10","雷霆道具卡×10","冠军礼盒×1"]
var wzzsarr=["火麒麟-巅峰荣耀皮肤","擎天-冠军之击皮肤","毁灭-冠军之怒皮肤","修罗-冠军之魂皮肤","属性变更券x10","交易专用钥匙x10"];
var zhuboarr=["雷神-荣耀世冠AG皮肤","火麒麟-荣耀世冠AG皮肤","屠龙-荣耀世冠AG皮肤","AG战队击杀图标","属性变更券x10","交易专用钥匙x10","属性变更券x10","交易专用钥匙x10"]
var suijiarr=["M200-幻神-荣耀世冠白鲨皮肤","QBZ03-荣耀世冠白鲨皮肤","麒麟刺-荣耀世冠白鲨皮肤","'黄金猫猫手套-白鲨","COP-白鲨","BS战队击杀图标","属性变更券x10","交易专用钥匙x10"]
var kaiqidebx=0;
function Linquptuan(){
    $("#milo_loader_layer").css("display", "block");
    setTimeout(function () {
        $("#milo_loader_layer").css("display", "none");
        for (let index = 0; index < 6; index++) {
            var sjs = Math.ceil(Math.random() * 6)-1;
            console.log("#tjl"+index+"  "+Ptuanhearr[sjs]+" "+sjs)
            $("#tjl"+index).text(Ptuanhearr[sjs]);
            $("#ttr"+index).css("display","flex");
            if(index==usertnum)
            {
                userhzid=sjs;
            }
        }
        if(userhzid==0)
        {
            SetjlZcx(16)
        }
        if(userhzid==3)
        {
            SetjlZcx(17)
        }
        if(userhzid==4)
        {
            SetjlZcx(22)
        }
        var strt="恭喜您获得了礼包："+Ptuanhearr[userhzid]+"，请注意：游戏虚拟道具奖品将会在24小时内到账"
$("#xtxx").text(strt);
$(".myGiftName").text(Ptuanhearr[userhzid])
kaiqidebx=userhzid;

Showwd("#xttc");

if(kaiqidebx==1||kaiqidebx==2||kaiqidebx==5)
{
    setTimeout(function(){
        var jlinamee=""
        var hezin=""
        var szzcxid=0
    if(kaiqidebx==1)
    {
        var sjs2 = Math.ceil(Math.random() * 100);
    
   
        if(sjs2<=100){ jlinamee=zhuboarr[5];  szzcxid=17 }
        if(sjs2<=50){ jlinamee=zhuboarr[4];  szzcxid=16}
        if(sjs2<=12){ jlinamee=zhuboarr[3];  szzcxid=21 }
        if(sjs2<=9){ jlinamee=zhuboarr[2];  szzcxid=20 }
        if(sjs2<=7){ jlinamee=zhuboarr[1];  szzcxid=19 }
        if(sjs2<=1){ jlinamee=zhuboarr[0];  szzcxid=18 }
        hezin="荣耀世冠AG礼盒"
     
    }
    if(kaiqidebx==5)
    {
        var sjs2 = Math.ceil(Math.random() * 100);
     
       
        if(sjs2<=100){ jlinamee=zhuboarr[5];  szzcxid=17 }
        if(sjs2<=50){ jlinamee=zhuboarr[4];  szzcxid=16 }
        if(sjs2<=12){ jlinamee=zhuboarr[3];  szzcxid=7}
        if(sjs2<=9){ jlinamee=zhuboarr[2];  szzcxid=6 }
        if(sjs2<=7){ jlinamee=zhuboarr[1];  szzcxid=5 }
        if(sjs2<=1){ jlinamee=zhuboarr[0];  szzcxid=4 }
        hezin="冠军礼盒"
     
    }
    if(kaiqidebx==2)
    {
        var sjs3 = Math.ceil(Math.random() * 100);
        if(sjs3<=100){ jlinamee=suijiarr[7];  szzcxid=17 }
        if(sjs3<=50){ jlinamee=suijiarr[6];  szzcxid=16 }
        if(sjs3<=24){ jlinamee=suijiarr[5];  szzcxid=9 }
        if(sjs3<=18){ jlinamee=suijiarr[4];  szzcxid=8 }
        if(sjs3<=12){ jlinamee=suijiarr[3];  szzcxid=3 }
        if(sjs3<=9){ jlinamee=suijiarr[2];  szzcxid=2 }
        if(sjs3<=7){ jlinamee=suijiarr[1];  szzcxid=1 }
        if(sjs3<=1){ jlinamee=suijiarr[0];  szzcxid=0 }
        hezin="荣耀世冠白鲨礼盒"
   
    }
    SetjlZcx(szzcxid)
    var strt2="恭喜您获得了礼包："+jlinamee+"  【开启"+hezin+"】";
    $("#xtxx").text(strt2);
    Showwd("#xttc");
    
    
    
    },1500)
}

    }, 200)

}

function Fwrandom(min, max) {
    min = Math.ceil(min);
    max = Math.floor(max);
    return Math.floor(Math.random() * (max - min + 1) + min);
   }
